﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WcfServiceIIS
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        public string GetMessage()
        {
            return "Hello from WCF service!!";
        }

        public GetLotterNumberResult GetLotterNumberCollection(ref Pagenation page)
        {
            List<LotterNumber> lotterCollection = new List<LotterNumber>();
            for (var i = page.StartRecordIndex; i < page.EndRecordIndex; i++)
            {
                lotterCollection.Add(new LotterNumber { Id = i, Number = i.ToString("d3") });
            }

            page.Count = 1000;

            return new GetLotterNumberResult { PageInfo = page, lotterNumberCollection = lotterCollection };
        }
    }
}
